package spring;

import org.junit.Test;
import org.springframework.core.io.UrlResource;

import java.io.IOException;

public class ResourceTest {

    @Test
    public void test() throws IOException {

        UrlResource urlResource=new UrlResource("https://www.baidu.com/");
       /*   InputStream inputStream = urlResource.getInputStream();
      byte[] contetn=new byte[1024*1024];
        inputStream.read(contetn);
        System.out.println(new String(contetn)); */
        System.out.println(urlResource.getDescription());
        System.out.println(urlResource.contentLength());
        System.out.println(urlResource.lastModified());


    }


}
